
 <!DOCTYPE HTML>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  
    <title>Git全解析之远程仓库交互 | wustrive&#39;s blog</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1">
    
    <meta name="author" content="wustrive">
    
    <meta name="description" content="Git全解析之远程仓库交互中央仓库的概念虽然说git是分布式版本控制工具，但同样有远程仓库的概念。出于各种目的，我们有时需要有一个共享的远程仓库，如GitHub上的仓库，我们公司项目中用来测试和部署的仓库等。一般的操作步骤是先在公共服务器上创建一个仓库，然后每个开发人员都clone这个仓库进行各自的">
    
    
    
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="wustrive" />
    <meta name="twitter:title" content="Git全解析之远程仓库交互 | wustrive&#39;s blog" />
      
    
    
    <link rel="alternate" href="/atom.xml" title="wustrive&#39;s blog" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/img/logo.ico">
    <link rel="apple-touch-icon-precomposed" href="/img/logo.ico">
    
    <link rel="stylesheet" href="/css/style.css">
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?5829c94e2ff91660826b6c0c188f5620";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>

</head>

  <body>
    <header>
      <div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.png" alt="wustrive&#39;s blog" title="wustrive&#39;s blog"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="wustrive&#39;s blog">wustrive&#39;s blog</a></h1>
				<h2 class="blog-motto">好记性不如写博客</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="菜单">
			</a></div>
			<nav class="animated">
				<ul>
					
						<li><a href="/">主页</a></li>
					
						<li><a href="/archives">归档</a></li>
					
						<li><a href="/aboutme">关于</a></li>
					
					<li>
					
					<form class="search" action="//google.com/search" method="get" accept-charset="utf-8">
						<label>Search</label>
						<input type="text" id="search" name="q" autocomplete="off" maxlength="20" placeholder="搜索" />
						<input type="hidden" name="q" value="site:wustrive2008.github.io">
					</form>
					
					</li>
				</ul>
			</nav>			
</div>

    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/01/11/版本控制/Git全解析之远程仓库交互/" title="Git全解析之远程仓库交互" itemprop="url">Git全解析之远程仓库交互</a>
  </h1>
  <p class="article-author">By
    
      <a href="https://wustrive2008.github.io" title="wustrive">wustrive</a>
    </p>
  <p class="article-time">
    <time datetime="2016-01-11T14:02:51.000Z" itemprop="datePublished">2016-01-11</time>
    更新日期:<time datetime="2016-11-05T18:14:33.000Z" itemprop="dateModified">2016-11-06</time>
    
  </p>
</header>
	<div class="article-content">
		
<div class="article-gallery">
  <div class="article-gallery-photos">
    
      <a class="article-gallery-img fancybox" href="http://7xifb5.com1.z0.glb.clouddn.com/wustrive-hexogit%E7%9F%A5%E8%AF%86%E7%BB%93%E6%9E%84.png" rel="gallery_civ5jdlhu002nuvfy5rd12ooo">
        <img src="http://7xifb5.com1.z0.glb.clouddn.com/wustrive-hexogit%E7%9F%A5%E8%AF%86%E7%BB%93%E6%9E%84.png" itemprop="image">
      </a>
    
  </div>
</div>

		
		<div id="toc" class="toc-article">
			<strong class="toc-title">文章目录</strong>
		<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Git全解析之远程仓库交互"><span class="toc-number">1.</span> <span class="toc-text">Git全解析之远程仓库交互</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#中央仓库的概念"><span class="toc-number">1.1.</span> <span class="toc-text">中央仓库的概念</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#本地分支与远程分支"><span class="toc-number">1.2.</span> <span class="toc-text">本地分支与远程分支</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#pull与fetch"><span class="toc-number">1.3.</span> <span class="toc-text">pull与fetch</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#关于捐赠"><span class="toc-number">1.4.</span> <span class="toc-text">关于捐赠</span></a></li></ol></li></ol>
		</div>
		
		<h2 id="Git全解析之远程仓库交互">Git全解析之远程仓库交互</h2><h3 id="中央仓库的概念">中央仓库的概念</h3><p>虽然说git是分布式版本控制工具，但同样有远程仓库的概念。出于各种目的，我们有时需要有一个共享的远程仓库，如GitHub上的仓库，我们公司项目中用来测试和部署的仓库等。<br>一般的操作步骤是先在公共服务器上创建一个仓库，然后每个开发人员都clone这个仓库进行各自的开发，开发完成后再push到远程仓库进行测试部署。</p>
<p>从远程仓库clone项目：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gitwork]$ </div><div class="line">[centos@bogon gitwork]$ git <span class="built_in">clone</span> git@github.com:wustrive2008/gittest.git</div><div class="line">Initialized empty Git repository <span class="keyword">in</span> /home/centos/gitwork/gittest/.git/</div><div class="line">remote: Counting objects: 4, done.</div><div class="line">remote: Compressing objects: 100% (3/3), done.</div><div class="line">remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0</div><div class="line">Receiving objects: 100% (4/4), 4.15 KiB, done.</div></pre></td></tr></table></figure></p>
<p>上面示例的远程仓库在github上，当然如果我们做的是公司的项目，出于安全性和访问效率的考虑很少会将公司的私有项目放到github上。一般的做法是搭建自己的git服务器，这里推荐两种git服务器工具：</p>
<ol>
<li><a href="http://git-scm.com/book/zh/v1/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-Gitolite" target="_blank" rel="external">Gitolite</a></li>
<li><a href="https://about.gitlab.com/" target="_blank" rel="external">GitLab</a></li>
</ol>
<p>这两个工具网上都有很多教程。</p>
<p>说明：github也有付费的企业版，试用过，也很好用</p>
<h3 id="本地分支与远程分支">本地分支与远程分支</h3><p>平时我们使用 git branch 查看的都是本地分支,如：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ git branch</div><div class="line">* master</div></pre></td></tr></table></figure></p>
<p>但是当需要经常与中央仓库同步代码时，特别是分支很多时，需要查看本地当前有哪些远程分支的引用，比便于在不同的分支之间进行切换开发。关于git分支的较好实践可以参考：<a href="https://github.com/nvie/gitflow" target="_blank" rel="external">git flow</a><br>查看远程分支的引用<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ </div><div class="line">[centos@bogon gittest]$ git branch <span class="_">-a</span></div><div class="line">* master</div><div class="line">  remotes/origin/HEAD -&gt; origin/master</div><div class="line">  remotes/origin/master</div></pre></td></tr></table></figure></p>
<p>上面的结果表示：<br>当前本地有一个master分支，并且有一个remotes/origin/master(远程master)分支的引用，至于remotes/origin/HEAD分支可以理解为origin/master分支的一个引用。<br>其中origin为远程仓库引用的别名，此名称可以修改，也可以有多个，可以参考git remote命令了解更多</p>
<p>接下来在本地创建一个develop分支，用于正常的开发流程：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ git checkout -b develop</div><div class="line">Switched to a new branch <span class="string">'develop'</span></div><div class="line">[centos@bogon gittest]$ git br</div><div class="line">* develop</div><div class="line">  master</div><div class="line">[centos@bogon gittest]$ git br <span class="_">-a</span></div><div class="line">* develop</div><div class="line">  master</div><div class="line">  remotes/origin/HEAD -&gt; origin/master</div><div class="line">  remotes/origin/master</div></pre></td></tr></table></figure></p>
<p>在develop分支上进行开发，并提交：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ touch file1.txt</div><div class="line">[centos@bogon gittest]$ git add .</div><div class="line">[centos@bogon gittest]$ git commit -am <span class="string">"create file file1.txt"</span></div><div class="line">[develop 21053d7] create file file1.txt</div><div class="line"> 0 files changed, 0 insertions(+), 0 deletions(-)</div><div class="line"> create mode 100644 file1.txt</div></pre></td></tr></table></figure></p>
<p>开发完成后将develop分支推送到服务器：<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ git push origin </div><div class="line">Counting objects: 4, done.</div><div class="line">Compressing objects: 100% (2/2), done.</div><div class="line">Writing objects: 100% (3/3), 311 bytes, done.</div><div class="line">Total 3 (delta 0), reused 0 (delta 0)</div><div class="line">To git@github.com:wustrive2008/gittest.git</div><div class="line">   8a9a114..21053d7  develop -&gt; develop</div></pre></td></tr></table></figure></p>
<p>接下来正常的流程是测试人员拉取到远程的develop分支，然后对develop分支上提交的内容进行测试，测试通过后，合并到master分支，最后推送到部署服务器进行上线部署。</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ git checkout master</div><div class="line">Switched to branch <span class="string">'master'</span></div><div class="line">[centos@bogon gittest]$ git merge develop</div><div class="line">Updating 8a9a114..21053d7</div><div class="line">Fast-forward</div><div class="line"> 0 files changed, 0 insertions(+), 0 deletions(-)</div><div class="line"> create mode 100644 file1.txt</div><div class="line">[centos@bogon gittest]$ git push origin master</div><div class="line">Total 0 (delta 0), reused 0 (delta 0)</div><div class="line">To git@github.com:wustrive2008/gittest.git</div><div class="line">   8a9a114..21053d7  master -&gt; master</div></pre></td></tr></table></figure>
<h3 id="pull与fetch">pull与fetch</h3><p>如果要拉取远程仓库的代码，需要用到pull与fetch命令<br>这两个命令的区别是pull=fetch+merge</p>
<p>先来演示一下git pull，有其他开发者已经在develop分支上提交了新的内容，现在需要同步到本地<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ git br</div><div class="line">* develop</div><div class="line">  master</div><div class="line">[centos@bogon gittest]$ git <span class="built_in">log</span></div><div class="line">commit 21053d768d7af0c5cf90f63dc105891726094b43</div><div class="line">Author: wubaoguo &lt;wustrive_2008@126.com&gt;</div><div class="line">Date:   Mon Jan 11 22:35:50 2016 +0800</div><div class="line"></div><div class="line">    create file file1.txt</div><div class="line"></div><div class="line">commit 8a9a114ecbacfd5555ee417ab1dbe02a20db9a03</div><div class="line">Author: wubaoguo &lt;wustrive2008@users.noreply.github.com&gt;</div><div class="line">Date:   Mon Jan 11 22:08:39 2016 +0800</div><div class="line"></div><div class="line">    Initial commit</div><div class="line">[centos@bogon gittest]$ git pull origin develop</div><div class="line">remote: Counting objects: 2, done.</div><div class="line">remote: Compressing objects: 100% (2/2), done.</div><div class="line">remote: Total 2 (delta 1), reused 1 (delta 0), pack-reused 0</div><div class="line">Unpacking objects: 100% (2/2), done.</div><div class="line">From github.com:wustrive2008/gittest</div><div class="line"> * branch            develop    -&gt; FETCH_HEAD</div><div class="line">Updating 21053d7..2296978</div><div class="line">Fast-forward</div><div class="line"> 0 files changed, 0 insertions(+), 0 deletions(-)</div><div class="line"> create mode 100644 file2.txt</div><div class="line">[centos@bogon gittest]$ git <span class="built_in">log</span></div><div class="line">commit 22969782f467<span class="built_in">cd</span>04410c9ed3cf5c80e3987d212b</div><div class="line">Author: wubaoguo &lt;wustrive_2008@126.com&gt;</div><div class="line">Date:   Mon Jan 11 22:52:18 2016 +0800</div><div class="line"></div><div class="line">    create file file2.txt</div><div class="line"></div><div class="line">commit 21053d768d7af0c5cf90f63dc105891726094b43</div><div class="line">Author: wubaoguo &lt;wustrive_2008@126.com&gt;</div><div class="line">Date:   Mon Jan 11 22:35:50 2016 +0800</div><div class="line"></div><div class="line">    create file file1.txt</div><div class="line"></div><div class="line">commit 8a9a114ecbacfd5555ee417ab1dbe02a20db9a03</div><div class="line">Author: wubaoguo &lt;wustrive2008@users.noreply.github.com&gt;</div><div class="line">Date:   Mon Jan 11 22:08:39 2016 +0800</div><div class="line"></div><div class="line">    Initial commit</div></pre></td></tr></table></figure></p>
<p>很清楚的看到，新的代码已经拉取并合并到本地了，可以基于最新的代码进行开发了。</p>
<p>如果开发者B说他向远程仓库推送了新的分支fixbug，需要你在此基础上继续修改bug，可以这样做<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div></pre></td><td class="code"><pre><div class="line">[centos@bogon gittest]$ git br <span class="_">-a</span>     <span class="comment">#可以看到这时本地并没有新的分支与引用</span></div><div class="line">* develop</div><div class="line">  master</div><div class="line">  remotes/origin/HEAD -&gt; origin/master</div><div class="line">  remotes/origin/develop</div><div class="line">  remotes/origin/master</div><div class="line">[centos@bogon gittest]$ git fetch    <span class="comment">#拉取远程所有的变动</span></div><div class="line">remote: Counting objects: 3, done.</div><div class="line">remote: Compressing objects: 100% (1/1), done.</div><div class="line">remote: Total 3 (delta 1), reused 3 (delta 1), pack-reused 0</div><div class="line">Unpacking objects: 100% (3/3), done.</div><div class="line">From github.com:wustrive2008/gittest</div><div class="line">   21053d7..2296978  develop    -&gt; origin/develop</div><div class="line"> * [new branch]      fixbug     -&gt; origin/fixbug   <span class="comment">#注意这里拉取到一个新分支</span></div><div class="line">[centos@bogon gittest]$ git br  <span class="comment">#这时本地并没有fixbug分支</span></div><div class="line">* develop</div><div class="line">  master</div><div class="line">[centos@bogon gittest]$ git checkout fixbug  <span class="comment">#创建并切换到fixbug分支,引用origin/fixbug分支</span></div><div class="line">Branch fixbug <span class="built_in">set</span> up to track remote branch fixbug from origin.</div><div class="line">Switched to a new branch <span class="string">'fixbug'</span></div></pre></td></tr></table></figure></p>
<p>与远程仓库的交互操作基本就这些，还有一点要注意，推送之前最好先拉取一下，因为如果远程分支版本比本地新，直接推送会失败。</p>
<h3 id="关于捐赠">关于捐赠</h3><p>如何觉得本文章对你有帮助，欢迎通过支付宝捐赠来支持博主</p>
<p><img src="http://7xifb5.com1.z0.glb.clouddn.com/wustrive-hexo%E6%94%AF%E4%BB%98%E5%AE%9D%E4%BB%98%E6%AC%BE%E4%BA%8C%E7%BB%B4%E7%A0%81%E6%9C%80%E5%B0%8F.png" alt="捐赠"></p>
  
	</div>
		<footer class="article-footer clearfix">

  <div class="article-tags">
  
  <span></span> <a href="/tags/git/">git</a><a href="/tags/版本控制/">版本控制</a><a href="/tags/项目管理/">项目管理</a>
  </div>


<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/版本控制/">版本控制</a>
</div>



<div class="article-share" id="share">

  <div data-url="https://wustrive2008.github.io/2016/01/11/版本控制/Git全解析之远程仓库交互/" data-title="Git全解析之远程仓库交互 | wustrive&#39;s blog" data-tsina="null" class="share clearfix">
  </div>

</div>
</footer>   	       
	</article>
	
<nav class="article-nav clearfix">
 
 <div class="prev" >
 <a href="/2016/01/14/js/arrayFunction/" title="javaScript数组方法总结">
  <strong>PREVIOUS:</strong><br/>
  <span>
  javaScript数组方法总结</span>
</a>
</div>


<div class="next">
<a href="/2016/01/08/python/python闭包与装饰器/"  title="python闭包与装饰器">
 <strong>NEXT:</strong><br/> 
 <span>python闭包与装饰器
</span>
</a>
</div>

</nav>

	
<section class="comment">
	<div class="ds-thread"></div>
</section>

</div>  
      <div class="openaside"><a class="navbutton" href="#" title="显示侧边栏"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">文章目录</strong>
  <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#Git全解析之远程仓库交互"><span class="toc-number">1.</span> <span class="toc-text">Git全解析之远程仓库交互</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#中央仓库的概念"><span class="toc-number">1.1.</span> <span class="toc-text">中央仓库的概念</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#本地分支与远程分支"><span class="toc-number">1.2.</span> <span class="toc-text">本地分支与远程分支</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#pull与fetch"><span class="toc-number">1.3.</span> <span class="toc-text">pull与fetch</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#关于捐赠"><span class="toc-number">1.4.</span> <span class="toc-text">关于捐赠</span></a></li></ol></li></ol>
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="隐藏侧边栏"></a></div>
<aside class="clearfix">

  
<div class="categorieslist">
	<p class="asidetitle">分类</p>
		<ul>
		
			<li><a href="/categories/DB/" title="DB">DB<sup>1</sup></a></li>
		
			<li><a href="/categories/Linux/" title="Linux">Linux<sup>6</sup></a></li>
		
			<li><a href="/categories/UML/" title="UML">UML<sup>1</sup></a></li>
		
			<li><a href="/categories/cORc/" title="cORc++">cORc++<sup>1</sup></a></li>
		
			<li><a href="/categories/hexo/" title="hexo">hexo<sup>1</sup></a></li>
		
			<li><a href="/categories/http协议/" title="http协议">http协议<sup>2</sup></a></li>
		
			<li><a href="/categories/java/" title="java">java<sup>10</sup></a></li>
		
			<li><a href="/categories/js/" title="js">js<sup>1</sup></a></li>
		
			<li><a href="/categories/nginx/" title="nginx">nginx<sup>1</sup></a></li>
		
			<li><a href="/categories/python/" title="python">python<sup>2</sup></a></li>
		
			<li><a href="/categories/分享/" title="分享">分享<sup>1</sup></a></li>
		
			<li><a href="/categories/摘录/" title="摘录">摘录<sup>1</sup></a></li>
		
			<li><a href="/categories/版本控制/" title="版本控制">版本控制<sup>3</sup></a></li>
		
			<li><a href="/categories/算法/" title="算法">算法<sup>2</sup></a></li>
		
			<li><a href="/categories/缓存/" title="缓存">缓存<sup>1</sup></a></li>
		
			<li><a href="/categories/网络协议/" title="网络协议">网络协议<sup>1</sup></a></li>
		
			<li><a href="/categories/网络安全/" title="网络安全">网络安全<sup>1</sup></a></li>
		
			<li><a href="/categories/设计模式/" title="设计模式">设计模式<sup>2</sup></a></li>
		
			<li><a href="/categories/读书笔记/" title="读书笔记">读书笔记<sup>10</sup></a></li>
		
		</ul>
</div>


  
<div class="tagslist">
	<p class="asidetitle">标签</p>
		<ul class="clearfix">
		
			<li><a href="/tags/Arraylist/" title="Arraylist">Arraylist<sup>1</sup></a></li>
		
			<li><a href="/tags/Centos/" title="Centos">Centos<sup>2</sup></a></li>
		
			<li><a href="/tags/DB/" title="DB">DB<sup>1</sup></a></li>
		
			<li><a href="/tags/Docker/" title="Docker">Docker<sup>1</sup></a></li>
		
			<li><a href="/tags/Email/" title="Email">Email<sup>1</sup></a></li>
		
			<li><a href="/tags/HashMap/" title="HashMap">HashMap<sup>1</sup></a></li>
		
			<li><a href="/tags/HotSpot/" title="HotSpot">HotSpot<sup>1</sup></a></li>
		
			<li><a href="/tags/IMAP/" title="IMAP">IMAP<sup>1</sup></a></li>
		
			<li><a href="/tags/Java/" title="Java">Java<sup>1</sup></a></li>
		
			<li><a href="/tags/Linux/" title="Linux">Linux<sup>5</sup></a></li>
		
			<li><a href="/tags/OOM/" title="OOM">OOM<sup>1</sup></a></li>
		
			<li><a href="/tags/POP3/" title="POP3">POP3<sup>1</sup></a></li>
		
			<li><a href="/tags/SMTP/" title="SMTP">SMTP<sup>1</sup></a></li>
		
			<li><a href="/tags/Tomcat/" title="Tomcat">Tomcat<sup>1</sup></a></li>
		
			<li><a href="/tags/UML/" title="UML">UML<sup>1</sup></a></li>
		
			<li><a href="/tags/aes/" title="aes">aes<sup>1</sup></a></li>
		
			<li><a href="/tags/array/" title="array">array<sup>1</sup></a></li>
		
			<li><a href="/tags/arraylist/" title="arraylist">arraylist<sup>1</sup></a></li>
		
			<li><a href="/tags/c/" title="c">c<sup>2</sup></a></li>
		
			<li><a href="/tags/chkconfig/" title="chkconfig">chkconfig<sup>1</sup></a></li>
		
		</ul>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS 订阅</a>
</div>

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hello, I&#39;m wustrive. This is my blog on GitHub. <br/>
			I wish you happiness</p>
	</section>
	 
	<div class="social-font clearfix">
		
		<a href="http://weibo.com/12100106" target="_blank" title="weibo"></a>
		
		
		<a href="https://twitter.com/wustrive" target="_blank" title="twitter"></a>
		
		
		<a href="https://github.com/wustrive2008" target="_blank" title="github"></a>
		
		
		
	</div>
		<p class="copyright">Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/A-limon/pacman" target="_blank" title="Pacman">Pacman</a> © 2018 
		
		<a href="https://wustrive2008.github.io" target="_blank" title="wustrive">wustrive</a>
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else
    {
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      h  = $('article h2')
      ah = $('article h2'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  if(ah.length==0){
    t.css('display','none');
  }else{
    c.click(function(){
      ta.css('display', 'block').addClass('fadeIn');
    });
    o.click(function(){
      ta.css('display', 'none');
    });
    $(window).scroll(function(){
      ta.css("top",Math.max(140,320-$(this).scrollTop()));
    });
  };
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina');
  var html = [
  '<a href="#" class="overlay" id="qrcode"></a>',
  '<div class="qrcode clearfix"><span>扫描二维码分享到微信朋友圈</span><a class="qrclose" href="#share"></a><strong>Loading...Please wait</strong><img id="qrcode-pic" data-src="http://s.jiathis.com/qrcode.php?url=' + encodedUrl + '"/></div>',
  '<a href="#textlogo" class="article-back-to-top" title="Top"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="QRcode"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="Weibo"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);
  $('.article-share-qrcode').click(function(){
    var imgSrc = $('#qrcode-pic').attr('data-src');
    $('#qrcode-pic').attr('src', imgSrc);
    $('#qrcode-pic').load(function(){
        $('.qrcode strong').text(' ');
    });
  });
});     
</script>


<script type="text/javascript">
  var duoshuoQuery = {short_name:"wustrive"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 




<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-22190106-2', 'auto');  
ga('send', 'pageview');
</script>


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-22190106-2', 'auto');
  ga('send', 'pageview');

</script>

  </body>
</html>
